{include file="public/public"}
<style type="text/css">
	#show tr td {
		overflow: hidden;
	}
	#show tr td p {
		width: 150px;
		float: left;
		text-align: center;
	}
	.content_ssft ul li {
		margin: 0 10px 100px;
	}
</style>
<style>
	.td_head{
		font-weight: bold;
		text-align:center;
		width:100px;
		font-size:1.3em;
		font-family:'微软雅黑';
	}
	.con_td{
		text-align: left;
		padding-left:10px;
		width:100px;
		font-size:1.2em;
		border-left:1px solid #cecece;
	}
	tr td:last-child{
		text-align:left;
		padding-left:15px;
	}
	#show_wait{
		position:absolute;
		top:150px;
		left:250px;
		width:128px;height:128px;
		border:0px;
		background:url(__PUBLIC__/images/oper_wait.gif) no-repeat 0 center;
	}
	.ssft_cbg_off{ background:url(__PUBLIC__/images/ssfa_lvbg_off.jpg);width:87px;height:34px;line-height:17px;text-align:center;color:#FFF;margin-bottom:15px;}
	.ssft_cbg_offvpn{ background:url(__PUBLIC__/images/ssfa_cbg6.jpg);width:87px;height:34px;line-height:17px;text-align:center;color:#FFF;margin-bottom:15px;}
	.ssft_cbg_offline{ background:url(__PUBLIC__/images/ssfa_cbg5.jpg);width:87px;height:34px;line-height:17px;text-align:center;color:#FFF;margin-bottom:15px;}
	#color_box li{height:40px;}
	.content_ssft ul li a{
				background: none;
			}
</style>
<script>
function sousuofangjian(){
	var sourname = $("#sourname").val();
	window.location.href='__APP__/admin/operationData?rname='+sourname;
}
function offclick(val){
	alert('该服务器已掉线');
	showclick(val);
}
function offvpn(val){
	alert('该服务器VPN已断线');
	showclick(val);
}
function showclick(val){
	$('#show_wait').show();
    var json=JSON.parse(val);
    var hotelId = json.id;
    var hotelname = json.hotel;
	$.post('__APP__/admin/getOperation',{'hotelId':hotelId},function(data){
		if(data.result){
			var html = data.msg.strhtml;
			$('#addtime').html(data.msg.strtime);
			$('#new_hotelname').html(hotelname);
			var excelData = JSON.stringify(data.msg.excelData);
			var headData = $('#head_title_table').text();
			$('#loadTable').val(excelData);
			$('#loadTableHead').val(headData);
			$('#operContainer tr[id!=closeContainer]').remove();
			$('#operContainer').prepend(html);
			$('#show_wait').hide();
			$("#show").show();
		}else{
			$('#show_wait').hide();
			alert(data.msg);
			return false;
		}
	},"json");
}
function quxiao0(){
	$("#show0").hide();
}

</script>

<div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
	<div class="layui-body layui-tab-content site-demo site-demo-body">
		<div class="layui-tab-item layui-show">
			<div class="layui-main">
				<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;"></fieldset>
				<span class="layui-breadcrumb">
                    <a href="__APP__/{$menuConfigArry['functionMod']}/{$menuConfigArry['menuLabel']}">{$menuConfigArry['pmenuName']}</a>
                    <a><cite>{$menuConfigArry['menuName']}</cite></a>
                </span>
				<hr>
				<div class="layui-form-item" style="margin-top: 20px;">
					<div class="layui-inline">
						<label class="layui-form-label">按酒店名</label>
						<div class="layui-input-inline">
							<input id='souname' name="text2" type="text" class="layui-input" />
						</div>
						<a href="#" onClick="subsou()" class="layui-btn ">搜索</a>
					</div>
					<div class="layui-inline">
						<a href="__APP__/admin/operationlog?type=hotel">操作日志</a>
					</div>
				</div>



				<div class="content_ssft">

					<ul style="width:800px;">
						<?php
					     	if($hotelArr){
					      		foreach($hotelArr as $val){
					      		$tmp = addslashes(json_encode($val));
								$timenow=time();
					      		$tmp = addslashes(json_encode($val));
					       	 	$timeDevice=$val[stime];
								$imgname = 'fangzi.png';
								if($val[vpnstate]==1){
									$imgname = 'fangzi_offvpn.png';
								}
					        	if(($timenow-$timeDevice)>900){
									$imgname = 'fangzi_offe.png';
								}
								switch($val[rstate]){
									case 1:
							?>
							<li style="float:left;">
								<a href="#" class="layui-btn layui-btn-sm" onclick='showclick("{$tmp}")'>
									<img src="__PUBLIC__/images/{$imgname}" style="margin-left: 12px;" />
									<p class="ssft_lvbg" {$style}>{$val[hotel]}</p>
								</a>

							</li>
							<?php
								break;
								case 2:
							?>
								<li style="float:left;">
									<a href="#" class="layui-btn layui-btn-sm" onclick='showclick("{$tmp}")'>
										<img src="__PUBLIC__/images/{$imgname}" style="margin-left: 12px;{$style}" />
										<p class="ssft_cbg" {$style}>{$val[hotel]}</p>
									</a>
								</li>
								<?php
									break;
									case 0:
								?>
									<li style="float:left;">
										<a href="#" class="layui-btn layui-btn-sm" onclick='alert("该服务器尚未上传数据");'>
											<img src="__PUBLIC__/images/{$imgname}" style="margin-left: 12px;" />
											<p class="ssft_cbg_off" {$style}>{$val[hotel]}</p>
										</a>
									</li>
									<?php
										break;
										}
									}
								}
							?>
					</ul>
				</div>
				<div class="blank"></div>
				    <div class="layui-box layui-laypage layui-laypage-default">{$page}</div>
			  	<div class="content_zh">
			   		<ul id='color_box'>
				   		<li><img src="__PUBLIC__/images/off_e.png" align="absmiddle">=掉线</span></li>
					    <li><img src="__PUBLIC__/images/off_vpn.png" align="absmiddle">=VPN断线</li>
					    <li><img src="__PUBLIC__/images/ssfa_cbg.jpg" align="absmiddle">=数据异常</li>
					    <li><img src="__PUBLIC__/images/ssfa_lvbg.jpg" align="absmiddle">=正常</li>
					    <li><img src="__PUBLIC__/images/ssfa_lvbg_off.jpg" align="absmiddle">=未上传数据</li>
			   		</ul>
			  	</div>
				
				<div id="show" style="DISPLAY:none" class="show">
		         	<table width="650" border="0" align="center" cellpadding="0" bgcolor="#FFFFFF" style="text-align:center; border:1px solid #e4e4e4;">
		           		<thead >
		             		<tr style='font-size:1.5em;'>
		                 		<td colspan="3" id='head_title_table'><span id='new_hotelname'></span>　<span id='addtime'></span>更新</td>
		                 		<input type="hidden" id="id" name="id">
		                 		<input type="hidden" id="ipaddr" name="ipaddr">
		                 		<input type="hidden" id="hotelName" name="hotelName">
		
		            	 	</tr>
		             	</thead>
		            	<tbody id='operContainer'>
		             		<tr class="ctt_gr" id='closeContainer'>
		                 		<td height="31" colspan="3" style='text-align:center;'>
			                 		<input name="submit22" type="button" value="关闭" border="0" onclick="document.getElementById('show').style.display='none'" class="layui-btn layui-btn-warm"/>
									<form action="__APP__/admin/outputOperation" method="post" style='display: inline;'>
										<input type='hidden'  id='loadTable' name='postTable'/>
										<input type='hidden'  id='loadTableHead' name='postTableHead'/>
										<input name="submit22" type="submit" value="导出" border="0" class="layui-btn"/>
			                		</form>
		                 		</td>
		             		</tr>
		             	</tbody>
		         	</table>
	
	     		</div>
	     		<div id="show_wait" style="DISPLAY:none" ></div>

			</div>
		</div>
	</div>
</div>
<style type="text/css">
	#allmap {
		height: 300px;
		width: 90%;
		margin: 0px auto;
		overflow: hidden;
		font-family: "微软雅黑";
	}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ZFrrzgw9CzThkNn5p1KkfmUe59MtYivE"></script>

<script language="javascript">
	$(function(){
		$('#sourname').keydown(function(e){
			if(e.keyCode==13){
				sousuofangjian();
			}
		});
	});
</script>